package com.itheima.stock.mapper;

import com.itheima.stock.pojo.domain.PermissionsTreeDomain;
import com.itheima.stock.pojo.entity.SysPermission;
import com.itheima.stock.pojo.vo.PermissionTreeNode;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 13975
* @description 针对表【sys_permission(权限表（菜单）)】的数据库操作Mapper
* @createDate 2024-04-21 19:31:27
* @Entity com.itheima.stock.pojo.entity.SysPermission
*/
public interface SysPermissionMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysPermission record);

    int insertSelective(SysPermission record);

    SysPermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysPermission record);

    int updateByPrimaryKey(SysPermission record);

    /**
     * 查找当前菜单的子集
     * @param id
     * @return
     */
    List<PermissionsTreeDomain> selectAllByPid(Long id);

    /**
     * 查询所有的权限，不用按照父亲id排序
     * @return
     */
    List<SysPermission> selectAll();

    /**
     * 查询所有权限的简略信息，以便以树状结构进行回显
     * @return
     */
    List<PermissionTreeNode> selectAllSimpleInfo();

    /**
     * 查询权限(没有按钮权限)
     * @param id
     * @return
     */
    SysPermission selectPermissionNoButtonByPrimaryKey(Long id);

    List<SysPermission> selectByIds(@Param("ids") List<Long> ids);


}
